package pl.lsierant.j2me.bipacz.log;

public class Logger {
    private static final boolean DEBUG = true;

    // prefix added to every logged message
    private String prefix;

    public Logger() {
    }

    public Logger(String prefix) {
        this.prefix = prefix;
    }

    public void log(String msg) {
        if (DEBUG)
            System.out.println((prefix != null ? prefix + ": " : "") + msg);
    }

    public void log(String msg, Object value) {
        if (DEBUG)
            System.out.println((prefix != null ? prefix + ": " : "") + msg + "" + value);
    }

    public void log(String msg, int value) {
        if (DEBUG)
            log(msg, new Integer(value));
    }

    public void log(String msg, long value) {
        if (DEBUG)
            log(msg, new Long(value));
    }

}
